import request from '@/utils/request'
import store from '@/store'
//const ascriptionId = store.state.userInfo.ascriptionId;

// 证书数据列表
export function booklistData(queryParamsbook) {
  const data = {
    ascriptionId: store.state.userInfo.ascriptionId,
    personnelId: queryParamsbook.personnelId,
    currentPage: queryParamsbook.currentPage,
    pagesize: queryParamsbook.pagesize,
    category:0
  }
  return request({
    url: '/getCertificateList',
    method: 'post',
    data: data
  })
}
// 证书数据添加
export function addCert(val) {
  const data = {
    projectContent: val
  }
  data.projectContent.ascriptionId = store.state.userInfo.ascriptionId
  return request({
    url: '/addCertificate',
    method: 'post',
    data: data
  })
}

// 证书获取单条数据
export function getCertData(theid) {
  const data = {
    theid
  }
  return request({
    url: '/getCertificateData',
    method: 'post',
    data: data
  })
}
// 证书数据修改
export function updateCert(val) {
    const data = {
        projectContent: val
    }
    data.projectContent.theid = theid
  return request({
    url: '/updateCertificate',
    method: 'post',
    data: data
  })
}
// 证书数据删除
export function delCert(theid) {
  const data = {
    theid
  }
  return request({
    url: '/delCertificate',
    method: 'post',
    data: data
  })
}